<!--
 * @Author: wuyue
 * @Date: 2023-03-06 16:24:10
 * @LastEditTime: 2023-03-23 17:49:02
 * @LastEditors: wuyue
 * @Descripttion: 计量设备发放详情
 * @version: 
-->
<template>
  <base-breadcrumb :title="$route.meta.title">
    <a-form-model ref="ruleForm" :model="form" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" :rules="{}" id="base-breadcrumb" style="position: relative">
      <a-spin :spinning="loading">
        <!-- 表单基础信息 -->
        <a-card :bordered="false">
           <equipment-base-form-module :form="form"> </equipment-base-form-module>
        </a-card>
        <!-- 计量设备发放信息 -->
        <a-card :bordered="false">
          <title-name title="计量设备发放信息"></title-name>
          <custom-form :is-emit="false" editModel="''" :formList="formList" :form="form" :formComponents="$refs"> </custom-form>
        </a-card>
        <!-- 页脚操作栏 -->
        <div class="btn_box page-btn-right-top">
          <a-button v-if="checkVisibleInDetail" type="primary" @click="handleActiveClose">关闭</a-button>
        </div>
      </a-spin>
    </a-form-model>
  </base-breadcrumb>
</template>

<script>
import { detailsItem } from '@/api/quality/meterageEquipmentGrant'
import BaseEditPage from '@/views/baseEditPage' // 编辑详情页基础配置
import moment from 'moment'
import equipmentBaseFormModule from '@/views/quality/equipmentManagement/module/equipmentBaseForm/index'
export default {
  name: 'a' + Date.now(),
  extends: new BaseEditPage(),
  components: { equipmentBaseFormModule },
  data() {
    return {
      loading: false,
      form: {}, // 表单
      formList: [
        {
          type: 'a-input',
          keyName: 'receiverCompany',
          label: '领用单位',
          disabled: true
        },
        {
          type: 'a-input',
          keyName: 'receiver',
          label: '领用人',
          disabled: true
        },
        {
          type: 'a-date-picker',
          keyName: 'receiveTime',
          label: '领用时间',
          disabled: true,
          attrs: {
            valueFormat: 'YYYY-MM-DD 00:00:00',
            format: 'YYYY-MM-DD'
          }
        },
        {
          type: 'a-input',
          keyName: 'receiveRemark',
          label: '领用备注',
          disabled: true
        }
      ]
    }
  },
  async created() {
    // 不为添加时请求详情
    this.loading = true
    detailsItem({
      id: this.id
    }).then(res => {
        this.loading = false
        this.form = res.data
      })
      .catch(() => {
        this.loading = false
      })
  },
}
</script>
